﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CrmList.aspx.cs" Inherits="CrmList" %>

<%@ Register Assembly="CrmControls" Namespace="CrmControls" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Veyron Crm</title>

    <script type="text/javascript" src="MasterMainSettings.js">  </script>

    <script type="text/javascript">
    function Check(parentChk)
    {
    var elements =  document.getElementsByTagName("INPUT");
     var element2=  document.getElementsByTagName("INPUT");
    for(i=0; i<elements.length;i++)
    {
        if(IsCheckBox(elements[i])&&elements[i].id=="chkAll")
        {       
          if(elements[i].checked==true)
            {
                for(var a =0;a<element2.length;a++)
                {
                    if(IsCheckBox(element2[a])&&element2[a].checked==false)
                    {
                    element2[a].checked=true;
                    }
                }
            
            }
            else
            {
            for(var a =0;a<element2.length;a++)
                {
                    if(IsCheckBox(element2[a])&&element2[a].checked==true)
                    {
                    element2[a].checked=false;
                    }
                }
            }
        }      
    
    }
   
    
    }
    function IsCheckBox(chk)
    {
        if(chk.type == 'checkbox') return true;
        else return false;
    }

    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div class="ListPageBackground">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <table style="width: 500px;">
            <tr>
                <td>
                    <table>
                        <tr>
                            <td>
                                <cc1:CrmLabel runat="server" Text="Type" ID="lblType"></cc1:CrmLabel>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <cc1:CrmLabel runat="server" ID="lblFind" Text="Bul"></cc1:CrmLabel>
                            </td>
                            <td>
                                <cc1:CrmTextBox runat="server" ID="txtSearch" KontrolTipi="Multi" BuyukHarf="Multi"
                                    Width="362px"></cc1:CrmTextBox>
                            </td>
                            <td>
                                <cc1:CrmButton runat="server" ID="btnGo" Text="Git" Width="100px" OnClick="btnGo_OnClick" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td>
                                <asp:Image runat="server" ID="imgciz" ImageUrl="~/images/ToolStrip/Vista/hr2.gif" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <cc1:CrmLabel runat="server" ID="lblRecord" Text="Mevcut Kayıtlar"></cc1:CrmLabel>
                            </td>
                        </tr>
                        <tr style="width: auto;">
                            <td style="width: 100%;">
                                <asp:Panel runat="server" ID="pnlGrid" Height="230px" ScrollBars="Auto" Width="500px">
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:GridView runat="server" ID="grdList" Width="100%" BackColor="White" BorderColor="#CCCCCC"
                                                    BorderStyle="None" BorderWidth="1px" CellPadding="3" OnRowCommand="grdList_RowCommand"
                                                    HeaderStyle-Font-Names="Arial" HeaderStyle-Font-Size="Smaller" HeaderStyle-Width="20px"
                                                    RowStyle-Font-Names="Arial" RowStyle-Width="10px" RowStyle-Font-Size="Smaller">
                                                    <FooterStyle BackColor="White" ForeColor="#000066" />
                                                    <RowStyle ForeColor="#000066" />
                                                    <Columns>
                                                        <asp:ButtonField Text="Seç" ControlStyle-ForeColor="Blue" />
                                                        <asp:TemplateField>
                                                            <HeaderTemplate>
                                                                <input type="checkbox" id="chkAll" name="chkAll" value="Tümünü Seç" onclick="Check(this)" />
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <%if (GridControl())
                                                                  {%>
                                                                <asp:CheckBox ID="CheckBox1" runat="server" Checked="true" />
                                                                <%}%>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                                                </asp:GridView>
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td>
                                <cc1:CrmButton runat="server" ID="btnDetails" Text="Özellikler" Width="100px" />
                                <cc1:CrmButton runat="server" ID="btnNew" Text="Yeni" Width="100px" OnClick="btnNew_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Image runat="server" ID="imgciz2" ImageUrl="~/images/ToolStrip/Vista/hr2.gif" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td style="width: 60%;">
                                <asp:HiddenField ID="HiddenField1" runat="server" />
                            </td>
                            <td style="float: right; width: 20%;">
                                <cc1:CrmButton runat="server" ID="btnOk" Text="Tamam" Width="100px" OnClick="btnOk_Click" />
                            </td>
                            <td style="float: right; width: 20%;">
                                <cc1:CrmButton runat="server" ID="btnCancel" Text="İptal" Width="100px" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
